const { Schema, SchemaTypes, model, models } = require("mongoose");
require("./Commodity");
require("./Page");
const IconSchema = new Schema(
    {
        icon: { type: String },
        name: { type: String },
        link: { type: String },
        prdId: { type: SchemaTypes.ObjectId, ref: "Commodity" },
        pageId: { type: SchemaTypes.ObjectId, ref: "Page" },
        orderIndex: { type: Number },
    },
    {
        timestamps: {
            createdAt: "createTime",
            updatedAt: "updateTime",
        },
    }
);
let IconModel = models["Icon"] || model("Icon", IconSchema);
module.exports = IconModel;
